;deprecated fn Server

(defn accion-de-agente
  [_ socket contenido]
  (with-open [input  (.getInputStream socket)
              output (PrintWriter. (.getOutputStream socket))]
    ;(print (char (.read input)))
    (.print output contenido)
    (.flush output)
    ))
;-------------------------------------------------------------------------------
(defn sirve
  []  
  (let [
        contenido      (slurp nombre-archivo)
        servidor       (ServerSocket. *port*)
        agente         (agent nil)
        ]
    (loop []
      
      (println "Esprando conexión...")      
      (let [socket (.accept servidor)]
        (print (char (.read (.getInputStream socket))))
        (send-off agente accion-de-agente socket contenido))
        ;(print (char (.read (.getInputStream socket)))))
      (recur))))
;-------------------------------------------------------------------------------
;(sirve)
